package org.gjy.m8.basic;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

/**
 * @author gjy
 * @version 1.0
 * @since 2024-01-31 14:39:54
 */
public class StringTest {

    @Test
    public void test2() {
        List<F> list = new ArrayList<>();
        list.add(new S());
        list.add(new S());
        System.out.println(list);
    }

    @Test
    public void test1() {
        List<S> list = new ArrayList<>();
        list.add((S) new F());
    }

    private static class F {

    }

    private static class S extends F {

    }
}
